DrawPattern EditPattern Initialize ShowPattern Pattern PatternSize ByteNum BitNum State RefTime Check CurrentByte CurrentColor PatternByte DrawPattern = DRAWPATTERN Draws a patterned rectangle on the right side of screen Set view to rectangle Use PAINT to fill itr Set view to full screen EditPattern = EDITPATTERN Edits a tile-byte pattern Starting position.= CHR$(0) is the first byte of the= two-byte string returned when a direction key such as UP or DOWN is pressed.n Calculate starting location on screen of this bit:= Wait for a key press (and flash cursor each 3/10 second): Check timer and switch cursor state if 3/10 second: Turn the border of bit on and off: Check for key press. Loop until a key is pressed.0 Erase cursor: Respond to key press. ESC key pressed:r exit this subprogramr SPACEBAR pressed: reset state of bits Invert bit in pattern string: Redraw bit on screen: ENTER key pressed: draw pattern in box on right. LEFT key: move cursor leftd RIGHT key: move cursor right UP key: move cursor up DOWN key: move cursor downh User pressed a key other than ESC, SPACEBAR, ENTER, UP, DOWN, LEFT, or RIGHT, so don't do anything.O Initialize = INITIALIZE Sets up starting pattern and screen ESC character is ASCII 27.= Set up an array holding bits in positions 0 to 7: Input the pattern size (in number of bytes):t Enter pattern size (1-16 rows):" Set initial pattern to all bits set: 640 x 200 monochrome graphics mode. Draw dividing lines:n Print titles: Pattern Bytes" Pattern View Draw editing screen for pattern:p Print label on left of each line: Draw "bit" boxes: Draw "Pattern View" box. DIRECTION keys........Move cursor" SPACEBAR............Changes point" ENTER............Displays pattern" ESC.........................Quits" ShowPattern = SHOWPATTERN Prints the CHR$ values used by PAINT to make pattern= Return screen to 80-column text mode: The following characters make up your pattern: Print out the value for each pattern byte:: CHR$(" New pattern? "